package com.pearadmin.system.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pearadmin.common.web.domain.request.PageDomain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pearadmin.system.mapper.ReportCourseTargetMapper;
import com.pearadmin.system.domain.ReportCourseTarget;
import com.pearadmin.system.service.IReportCourseTargetService;

/**
 * 报告课程目标信息Service业务层处理
 *
 * @author jmys
 * @date 2021-04-12
 */
@Service
public class ReportCourseTargetServiceImpl implements IReportCourseTargetService
{
    @Autowired
    private ReportCourseTargetMapper reportCourseTargetMapper;

    /**
     * 查询报告课程目标信息
     *
     * @param id 报告课程目标信息ID
     * @return 报告课程目标信息
     */
    @Override
    public ReportCourseTarget selectReportCourseTargetById(Long id)
    {
        return reportCourseTargetMapper.selectReportCourseTargetById(id);
    }

    /**
     * 查询报告课程目标信息列表
     *
     * @param reportCourseTarget 报告课程目标信息
     * @return 报告课程目标信息
     */
    @Override
    public List<ReportCourseTarget> selectReportCourseTargetList(ReportCourseTarget reportCourseTarget)
    {
        return reportCourseTargetMapper.selectReportCourseTargetList(reportCourseTarget);
    }

    /**
     * 查询报告课程目标信息
     * @param reportCourseTarget 报告课程目标信息
     * @param pageDomain
     * @return 报告课程目标信息 分页集合
     * */
    @Override
    public PageInfo<ReportCourseTarget> selectReportCourseTargetPage(ReportCourseTarget reportCourseTarget, PageDomain pageDomain)
    {
        PageHelper.startPage(pageDomain.getPage(),pageDomain.getLimit());
        List<ReportCourseTarget> data = reportCourseTargetMapper.selectReportCourseTargetList(reportCourseTarget);
        return new PageInfo<>(data);
    }

    /**
     * 新增报告课程目标信息
     *
     * @param reportCourseTarget 报告课程目标信息
     * @return 结果
     */

    @Override
    public int insertReportCourseTarget(ReportCourseTarget reportCourseTarget)
    {

        return reportCourseTargetMapper.insertReportCourseTarget(reportCourseTarget);
    }

    /**
     * 修改报告课程目标信息
     *
     * @param reportCourseTarget 报告课程目标信息
     * @return 结果
     */
    @Override
    public int updateReportCourseTarget(ReportCourseTarget reportCourseTarget)
    {
        return reportCourseTargetMapper.updateReportCourseTarget(reportCourseTarget);
    }

    /**
     * 删除报告课程目标信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteReportCourseTargetByIds(String[] ids)
    {
        return reportCourseTargetMapper.deleteReportCourseTargetByIds(ids);
    }

    /**
     * 删除报告课程目标信息信息
     *
     * @param id 报告课程目标信息ID
     * @return 结果
     */
    @Override
    public int deleteReportCourseTargetById(Long id)
    {
        return reportCourseTargetMapper.deleteReportCourseTargetById(id);
    }
}
